Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Render table dropdowns with correct icons #3898

Open
wants to merge 3 commits into
base: 8.3
Choose a base branch
from

Conversation

markusguenther
Copy link
Member

What I did
The icons were broken, and the fallback title was not aligned pretty well. So the SVG markup string will be transformed now to a data-uri and this can be used as an image source.

How to verify it
Described in the linked issue.

Resolves: #3897

The icons were broken and the fallback title was not aligned pretty well. So the SVG markup string will be transformed now to an data-uri and this can be used as image sorce.
@github-actions github-actions bot added Bug Label to mark the change as bugfix 8.3 labels Dec 10, 2024
@markusguenther
Copy link
Member Author

I already fixed that in the CKEditor Upgrade PR. Did not know that it happened in 8.3.
#3883

return (
<DropDown
padded={false}
>
<DropDown.Header title={this.props.i18nRegistry.translate(this.props.tooltip)}>
<img style={{verticalAlign: 'text-top'}} src={ckeIcons[this.props.icon]} alt={this.props.i18nRegistry.translate(this.props.tooltip)} />
<img style={{verticalAlign: 'text-top'}} src={iconDataUri} alt={this.props.i18nRegistry.translate(this.props.tooltip)} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

öhm do i get that right that we want to have the svgs as data-url and not as raw content string?
That can be done via the build setup. For the neos ui i introduced the convention that files ending with .dataurl.svg will get that treatment via the build setup already introduced via:

#3836

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue here was that the content of this.props.icon is just the SVG markup.
And that in a src tag is not working, and I bet that the build pipeline also doesn't handle it.

@@ -0,0 +1,47 @@
const REGEX = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol 😅 i hope you dindt had to write this yourself? :D I think more simple it would be to just use base64 decode and done :D

Edit: see comment above - i believe we dont need this at all hopefully

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can discuss other solutions of course :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simplified that and now use base64 for the inline dataUri SVG stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.3 Bug Label to mark the change as bugfix CKEditor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants